#ifndef socket_handle_H
#define socket_handle_H

#include "cfg_param.h"
#include "hal_tlv.h"

#define SeedCurrent_Slow_Change(current, channel)                                                                                                                                                      \
    hal_SeedCurrentSlowChange(current,CURRENT_SEPARAT_SEED, channel)
		//if (hal_LaserWriteValueNormal(JUDGE_LASER_LIMIT_TYPE_CURRENT_SEED, current, channel))                                                                                                              \
    hal_SeedCurrentSlowChange(current,CURRENT_SEPARAT_SEED, channel)

#define PDCurrent_Slow_Change(current, channel)                                                                                                                                                        \
    if (hal_LaserWriteValueNormal(JUDGE_LASER_LIMIT_TYPE_PD, current, channel))                                                                                                                        \
			hal_PDCurrentSlowChange(current, channel)
		
#define TACurrent_Slow_Change(current, SampCurType)                                                                                                                                                        \
    if (hal_LaserWriteValueNormal(JUDGE_LASER_LIMIT_TYPE_CURRENT_TA, current, channel))                                                                                                                        \
			hal_TACurrentSlowChange(current, SampCurType)
		
#define Temp_Direct_Change(temp, channel)                                                                                                                                                              \
    if (hal_LaserWriteValueNormal(JUDGE_LASER_LIMIT_TYPE_TEMP, temp, channel))                                                                                                                         \
			hal_TemptDirectChange(temp, channel)

#define Current_Copy_To_EEPROM(channel, current, bytesarrray)                                                                                                                                          \
    if (hal_LaserWriteValueNormal((channel == LASER_NUMBER_CHAN_1) ? JUDGE_LASER_LIMIT_TYPE_CURRENT_SEED : JUDGE_LASER_LIMIT_TYPE_CURRENT_TA, current, channel))                                       \
    floatToBytes(&current, bytesarrray)

#define Power_Copy_To_EEPROM(channel, pdcur, bytesarrray)                                                                                                                                              \
    if (hal_LaserWriteValueNormal(JUDGE_LASER_LIMIT_TYPE_PD, power, channel))                                                                                                                          \
    floatToBytes(&pdcur, bytesarrray)

#define Temp_Copy_To_EEPROM(channel, temp, bytesarrray)                                                                                                                                                \
    if (hal_LaserWriteValueNormal(JUDGE_LASER_LIMIT_TYPE_TEMP, temp, channel))                                                                                                                         \
    floatToBytes(&temp, bytesarrray)

#endif
